package com.ruoyi.blog.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author: user1
 * date: 2021/11/28
 */
@Component
public class ResourcesConfig {

    /**
     * 上传服务器路径
     */
    @Value("${file.path}")
    private String localFilePath;

    public String  getFullPath(String partPath){
        if(localFilePath.charAt(localFilePath.length() - 1) != '/'){
            localFilePath += "/";
        }
        return localFilePath + partPath;
    }
}
